package com.mercycrazy.springframework.jdbc.core;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * Interface specifying a basic set of JDBC operations
 *
 * @author <a href="mailto:1443424326@qq.com">mercycrazy</a>
 * @since 2022-12-04
 */
public interface JdbcOperations {

    <T> T execute(StatementCallback<T> action) throws SQLException;

    void execute(String sql);

    <T> T query(String sql, ResultSetExtractor<T> res);

    <T> List<T> query(String sql, RowMapper<T> rowMapper);

    List<Map<String, Object>> queryForList(String sql);
}
